menu: Allocate children according to scroll_offset
authorTimm Bäder <mail@baedert.org>
Fri, 20 Jul 2018 16:43:26 +0000 (18:43 +0200)
committerTimm Bäder <mail@baedert.org>
Sun, 5 Aug 2018 08:22:10 +0000 (10:22 +0200)
This was done by simply moving the bin_window before but now we have to
do it ourselves.

gtk/gtkmenu.c

index c98ba1bbb70273e82f3d85105dd56fd15d2291cb..b8d4f5aa1c7845beaa80147f8affe6d86ee31f63 100644 (file)
@@ -2580,7 +2580,7 @@ gtk_menu_size_allocate (GtkWidget           *widget,
               child_allocation.width = (r - l) * base_width;
               child_allocation.height = 0;
               child_allocation.x = l * base_width;
-              child_allocation.y = 0;
+              child_allocation.y = - priv->scroll_offset;
 
               for (i = 0; i < b; i++)
                 {
@@ -3726,6 +3726,7 @@ gtk_menu_scroll_to (GtkMenu *menu,
   gtk_css_node_set_state (bottom_arrow_node, priv->lower_arrow_state);
 
   priv->scroll_offset = offset;
+  gtk_widget_queue_allocate (GTK_WIDGET (menu));
 }
 
 static gboolean